import requests

from APIs.baseAPI import BaseAPI
from common.config import ip
class LoginAPI(BaseAPI):
    def login(self,uname="admin",upwd="123456"):
        mydata={"username":uname,"password":upwd}
        r=requests.post(f"{ip}/login",data=mydata)
        print(r)
        return r.json()
    def getToken(self):
        mydata={"username":"admin","password":"123456"}
        r=requests.post(f"{ip}/login",data=mydata)
        print(r)
        return r.json()["Admin-Token"]
if __name__ == '__main__':
    f=LoginAPI()
    print(f.login())